<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Deprecation info APIs | ElasticSearch 7.7 权威指南中文版</title>
	<meta name="keywords" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <meta name="description" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
	<script>
	var _link = 'migration-api-deprecation.html';
    </script>
</head>
<body>
<div class="main-container">
    <section id="content">
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/migration-api-deprecation.html" rel="nofollow" target="_blank">https://www.elastic.co/guide/en/elasticsearch/reference/7.7/migration-api-deprecation.html</a>, 原文档版权归 www.elastic.co 所有<br/>本地英文版地址: <a href="../en/migration-api-deprecation.html" rel="nofollow" target="_blank">../en/migration-api-deprecation.html</a></div>
                        <!-- start body -->
                  <div class="page_header">
<strong>重要</strong>: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html" rel="nofollow">当前版本文档</a>。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch Guide [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="rest-apis.html">REST APIs</a></span>
»
<span class="breadcrumb-link"><a href="migration-api.html">Migration APIs</a></span>
»
<span class="breadcrumb-node">Deprecation info APIs</span>
</div>
<div class="navheader">
<span class="prev">
<a href="migration-api.html">« Migration APIs</a>
</span>
<span class="next">
<a href="indices-reload-analyzers.html">Reload search analyzers API »</a>
</span>
</div>
<div class="section xpack">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="migration-api-deprecation"></a>Deprecation info APIs<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/migration/apis/deprecation.asciidoc">edit</a><a class="xpack_tag" href="https://www.elastic.co/subscriptions"></a>
</h2>
</div></div></div>

<div class="important admon">
<div class="icon"></div>
<div class="admon_content">
<p>Use this API to check for deprecated configuration before performing
a major version upgrade. You should run it on the the last minor version of the
major version you are upgrading from, as earlier minor versions may not include
all deprecations.</p>
</div>
</div>
<p>The deprecation API is to be used to retrieve information about different
cluster, node, and index level settings that use deprecated features that will
be removed or changed in the next major version.</p>
<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="migration-api-request"></a>Request<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/migration/apis/deprecation.asciidoc">edit</a>
</h3>
</div></div></div>
<p><code class="literal">GET /_migration/deprecations</code><br></p>
<p><code class="literal">GET /&lt;index_name&gt;/_migration/deprecations</code></p>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="migration-api-path-params"></a>Path parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/migration/apis/deprecation.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">index_name</code>
</span>
</dt>
<dd>
(Optional, string) Identifier for the index. It can be an index name or a
wildcard expression. When you specify this parameter, only index-level
deprecations for the specified indices are returned.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="migration-api-example"></a>Examples<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/migration/apis/deprecation.asciidoc">edit</a>
</h3>
</div></div></div>
<p>To see the list of offenders in your cluster, submit a GET request to the
<code class="literal">_migration/deprecations</code> endpoint:</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET /_migration/deprecations</pre>
</div>
<div class="console_widget" data-snippet="snippets/1863.console"></div>
<p>Example response:</p>
<div class="pre_wrapper lang-js">
<pre class="programlisting prettyprint lang-js">{
  "cluster_settings" : [
    {
      "level" : "critical",
      "message" : "Cluster name cannot contain ':'",
      "url" : "https://www.elastic.co/guide/en/elasticsearch/reference/7.7/breaking-changes-7.0.html#_literal_literal_is_no_longer_allowed_in_cluster_name",
      "details" : "This cluster is named [mycompany:logging], which contains the illegal character ':'."
    }
  ],
  "node_settings" : [ ],
  "index_settings" : {
    "logs:apache" : [
      {
        "level" : "warning",
        "message" : "Index name cannot contain ':'",
        "url" : "https://www.elastic.co/guide/en/elasticsearch/reference/7.7/breaking-changes-7.0.html#_literal_literal_is_no_longer_allowed_in_index_name",
        "details" : "This index is named [logs:apache], which contains the illegal character ':'."
      }
    ]
  },
  "ml_settings" : [ ]
}</pre>
</div>
<p>The response breaks down all the specific forward-incompatible settings that you
should resolve before upgrading your cluster. Any offending settings are
represented as a deprecation warning.</p>
<p>The following is an example deprecation warning:</p>
<div class="pre_wrapper lang-js">
<pre class="programlisting prettyprint lang-js">{
  "level" : "warning",
  "message" : "This is the generic descriptive message of the breaking change",
  "url" : "https://www.elastic.co/guide/en/elasticsearch/reference/6.0/breaking_60_indices_changes.html",
  "details" : "more information, like which nodes, indices, or settings are to blame"
}</pre>
</div>
<p>As is shown, there is a <code class="literal">level</code> property that describes the significance of the
issue.</p>
<div class="informaltable">
<table border="1" cellpadding="4px">
<colgroup>
<col class="col_1">
<col class="col_2">
</colgroup>
<tbody>
<tr>
<td align="left" valign="top"><p>warning</p></td>
<td align="left" valign="top"><p>You can upgrade directly, but you are using deprecated functionality
which will not be available or behave differently in the next major version.</p></td>
</tr>
<tr>
<td align="left" valign="top"><p>critical</p></td>
<td align="left" valign="top"><p>You cannot upgrade without fixing this problem.</p></td>
</tr>
</tbody>
</table>
</div>
<p>The <code class="literal">message</code> property and the optional <code class="literal">details</code> property provide descriptive
information about the deprecation warning. The <code class="literal">url</code> property provides a link to
the Breaking Changes Documentation, where you can find more information about
this change.</p>
<p>Any cluster-level deprecation warnings can be found under the <code class="literal">cluster_settings</code>
key. Similarly, any node-level warnings are found under <code class="literal">node_settings</code>. Since
only a select subset of your nodes might incorporate these settings, it is
important to read the <code class="literal">details</code> section for more information about which nodes
are affected. Index warnings are sectioned off per index and can be filtered
using an index-pattern in the query. Machine Learning related deprecation
warnings can be found under the <code class="literal">ml_settings</code> key.</p>
<p>The following example request shows only index-level deprecations of all
<code class="literal">logstash-*</code> indices:</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET /logstash-*/_migration/deprecations</pre>
</div>
<div class="console_widget" data-snippet="snippets/1864.console"></div>
</div>

</div>
<div class="navfooter">
<span class="prev">
<a href="migration-api.html">« Migration APIs</a>
</span>
<span class="next">
<a href="indices-reload-analyzers.html">Reload search analyzers API »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>